<?php
namespace app\admin\model;

use think\Model;

class User extends Model
{
    protected $table='cx_user';
    protected $pk='id';

    //本模型开启时间自动写入
    protected $autoWriteTimestamp = true;

    //年份杂志
    public function MagazineYear()
    {
        return $this->belongsToMany('MagazineYear','user_subscribe','pid','user_id');
    }
    // 小课
    public function Course()
    {
        return $this->belongsToMany('Course','user_subscribe','pid','user_id');
    }
    //Talkshow
    public function TalkShow()
    {
        return $this->belongsToMany('TalkShow','user_subscribe','pid','user_id');
    }
    //单期杂志
    public function Magazine()
    {
        return $this->belongsToMany('Magazine','user_subscribe','pid','user_id');
    }
}